// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 获取售后订单 */
export async function getSalesOrderList(params: API.SalesOrder.SalesOrderParams) {
  return request('/api/afterSalesOrder', {
    method: 'GET',
    params,
  });
}

/** 新增售后订单 */
export async function addSalesOrder(data: API.SalesOrder.SalesOrderData) {
  return request('/api/afterSalesOrder/add', {
    method: 'POST',
    data,
  });
}

/** 修改售后订单 */
export async function updateSalesOrder(data: API.SalesOrder.SalesOrderData) {
  return request('/api/afterSalesOrder/update', {
    method: 'POST',
    data,
  });
}

/** 删除售后订单 */
export async function deleteSalesOrder(id: number) {
  return request('/api/afterSalesOrder/delete', {
    method: 'DELETE',
    params: { id },
  });
}

/** 订单标记 */
export async function marksAfterSalesOrder(params: { id: number; mark: string }) {
  return request('/api/afterSalesOrder/mark', {
    method: 'GET',
    params,
  });
}

/** 支付 */
export async function payAfterSalesOrder(params: { id: number; money_pay: number }) {
  return request('/api/afterSalesOrder/pay', {
    method: 'GET',
    params,
  });
}

/** 下拉框 */
export async function selectAfterSalesOrder() {
  return request('/api/afterSalesOrder/select', {
    method: 'GET',
  });
}
